package org.xx.armory.swing.components.formatters;

import org.xx.armory.objectparser.ParserException;

import java.text.ParseException;

public class SimpleTextFormatter
        extends AbstractTextFormatter {
    public SimpleTextFormatter(
            String prefix,
            String suffix
    ) {
        super(prefix, suffix);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected String valueToString2(
            Object value
    )
            throws ParserException {
        return value != null ? value.toString() : "";
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected Object stringToValue2(
            String text
    )
            throws ParseException {
        return text;
    }
}
